<template>

		<view class="box">
			<view class="box_item" v-for="item,index in list" :key="index">
				<view class="box_item_title">
					<text>{{ item.areaName }}</text>
				</view>
				<view class="box_item_box">
					<view
						class="box_item_box_item"
						v-for="items,indexs in item.projects"
						:key="indexs"
						@click="jumpCQ(item, items)"
					>
						<view><image :src="items.showProjectPictures"></image></view>
						<text>{{ items.projectName }}</text>
					</view>
					<view class="box_item_box_items"></view>
					<view class="box_item_box_items"></view>
				</view>
			</view>
			<view class="no-list" v-if="!list || list.length == 0">
				<image src="@/static/images/default_empty.png"></image>
				<view>暂无数据</view>
			</view>
		</view>
</template>

<script>
	// import { itemList } from '../../api/index'
export default {
	data() {
		return {
			list: [],
			yq: ''
		};
	},
	onLoad: function(options) {
		this.itemList();
		
		if (options.yq) {
			this.yq = options.yq 
		}
	},
	methods: {
		// 跳转选择场区
		jumpCQ(item, items) {
			uni.navigateTo({
				url: `/pages/fieldArea/fieldArea?cqid=${item.id}&xmid=${items.id}&title=${items.projectName}`
			});
		},
		// 场区项目列表
		itemList() {
			this.$app.ajax({
				data: {
					userId: uni.getStorageSync('userId'),
					param: {
						venueId: uni.getStorageSync('GYMID')
					}
				},
				api: this.$api.itemList()
			}).then(res => {
				if (res.errorCode != '000000') return;
				this.list = res.recordList
			});
		},

		jump() {
			uni.navigateTo({
				url: '/pages/fieldArea/fieldArea'
			});
		}
	}
};
</script>

<style lang="scss">
page {
	width: 100%;
	height: 100%;
	background: #f7f7f7;
}

.box_item {
	padding: 30rpx;
	background: #ffffff;
	margin-bottom: 24rpx;
}

.box_item_title text {
	font-size: 32rpx;
	font-weight: 600;
	color: #333333;
}

.box_item_box {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
}

.box_item_box_item view {
	width: 96rpx;
	height: 96rpx;
	/* background: rgba(255, 133, 75, 0.09); */
	border-radius: 8rpx;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.box_item_box_item image {
	width: 96rpx;
	height: 96rpx;
}

.box_item_box_item text {
	font-size: 26rpx;
	font-family: PingFangSC-Regular, PingFang SC;
	font-weight: 400;
	color: #222222;
	margin-top: 15rpx;
}

.box_item_box_blue {
	background: rgba(65, 103, 193, 0.06) !important;
}

.box_item_box_items {
	width: calc(100% / 4.5);
}

.box_item_box_item {
	width: 25%;
	padding: 20rpx;
	box-sizing: border-box;
	/* background: rgba(221, 80, 64, 0.06); */
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	margin-top: 40rpx;
}

.box_item_box_item_j {
	width: calc(100% / 4.5);
}
</style>
